#pragma once
#include "ActionNode.h"

struct lastMerge  
{
	ActionNode *lastMergedChildNode;
	ActionNode *lastMergedChildPreviousParent;
	string lastMergedObservation;
};

struct OcurancesOfAction
{
	string action;
	int ocurances;
};

class PPR
{
private:
	ActionNode * _rootNode;

	//ActionNode *_lastMergedNode;
	//string _lastMergedObservation;
	//ActionNode *_branchLastParent;
	

public:
	PPR(void);
	__declspec(dllexport) PPR(ActionNode * rootActionNode);
	__declspec(dllexport) ActionNode * PPR::GetRootNode();

	__declspec(dllexport) bool PPR::CanMergeWithBranch(PPR branch);
	__declspec(dllexport) lastMerge PPR::MergeWithBranch(PPR branch);
	__declspec(dllexport) void PPR::RevertLastMerge(lastMerge last);

	__declspec(dllexport) OcurancesOfAction PPR::GetOcurancesOfActionFromSearchString(string searchString);
	
	__declspec(dllexport) int PPR::FillInMissingBranches(double epsilon);
};
